﻿@model MvcWeb.ViewModels.Manager.ManagerModel
@{
    ViewBag.Title = "资产编辑";
}
@if (false)
{
    <script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
}
<div style="padding: 10px;">
    <div style="padding-bottom: 5px;">
        <a href="@Url.Action("index")" class="btn_green">返回资产分类列表</a>
    </div>
    @using (Html.BeginForm())
    {
        <div style="line-height: 30px; font-weight: bold; color: Red;">
        </div>
        <table class="tb">
            <tr>
                <td class="editor-label">名称<span class="red">(*)</span></td>
                <td colspan="3">
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetName, new { @style = "width:98%;" })
                    <input type="hidden" id="aid" value="@(Model.assetManagerModel.AssetID)" />
                </td>
            </tr>
            <tr>
                <td class="editor-label">标签</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetLabel, new { disabled = true })
                </td>
                <td class="editor-label">添加数量</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerCount)件 </td>
            </tr>
            <tr>
                <td class="editor-label">类型<span class="red">(*)</span></td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetCID, new SelectList((Dictionary<int, string>)ViewData["categoryTypeList"], "key", "value"), "请选择类型", new { @onchange = "getExtForm(this.value)" })
                </td>
                <td class="editor-label">等级<span class="red">(*)</span></td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetLevel, new SelectList((Dictionary<int, string>)ViewData["AssetLevelList"], "key", "value"), "请选择等级")
                </td>
            </tr>
            <tr>
                <td class="editor-label">资产来源<span class="red">(*)</span></td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetFrom, new SelectList((Dictionary<int, string>)ViewData["AssetFromList"], "key", "value"), "请选择资产来源")
                </td>
                <td class="editor-label">状态<span class="red">(*)</span></td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetStatus, new SelectList((Dictionary<int, string>)ViewData["AssetStatusList"], "key", "value"), "请选择状态")
                </td>
            </tr>
            <tr>
                <td class="editor-label">资产去处</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetOut, new SelectList((Dictionary<int, string>)ViewData["AssetOutList"], "key", "value"), "请选择去处")
                </td>
                <td class="editor-label">条形码</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetBarcode)
                </td>
            </tr>
            <tr>
                <td class="editor-label">出厂日期</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetOutManu)
                </td>
                <td class="editor-label">保修年限</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetWarrant)单位年 </td>
            </tr>
            <tr>
                <td class="editor-label">购入日期</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetBuyTime)
                </td>
                <td class="editor-label">保修逾期日期</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetWarrantLastTime)
                </td>
            </tr>
            <tr>
                <td class="editor-label">品牌商</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetBrand, new SelectList((Dictionary<int, string>)ViewData["brandList"], "key", "value"), "请选择品牌商")
                    或
                    @Html.TextBoxFor(m => m.BrandName)
                </td>
                <td class="editor-label">供应商</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetSupply, new SelectList((Dictionary<int, string>)ViewData["supplyList"], "key", "value"), "请选择供应商")
                    或
                    @Html.TextBoxFor(m => m.Supplier)
                </td>
            </tr>
            <tr>
                <td class="editor-label">采购人</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetPurchaseID, new SelectList((Dictionary<Guid, string>)ViewData["AssetPurchaseIDList"], "key", "value"), "请选择采购人")
                </td>
                <td class="editor-label">采购成本</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetPurchaseCost)单位元 </td>
            </tr>
            <tr>
                <td class="editor-label">资金来源</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetPurchaseCostFrom, new SelectList((Dictionary<int, string>)ViewData["AssetPurchaseCostFromList"], "key", "value"), "请选择资金来源")
                </td>
                <td class="editor-label">所在部门</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetDepartID, new SelectList((Dictionary<int, string>)ViewData["AssetDepartIDList"], "key", "value"), "请选择部门")
                </td>
            </tr>
            <tr>
                <td class="editor-label">保管人</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetCustodyMemberID, new SelectList((Dictionary<Guid, string>)ViewData["AssetCustodyMemberIDList"], "key", "value"), "请选择保管人")
                </td>
                <td class="editor-label">保管地点</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetCustodyAddress, new { @style = "width:98%;" })
                </td>
            </tr>
            <tr>
                <td class="editor-label">使用人</td>
                <td>
                    @Html.DropDownListFor(m => m.assetManagerModel.AssetUsedMemberID, new SelectList((Dictionary<Guid, string>)ViewData["AssetUsedMemberIDList"], "key", "value"), "请选择使用人")
                </td>
                <td class="editor-label">使用地点</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetUsedAddress, new { @style = "width:98%;" })
                </td>
            </tr>
            <tr>
                <td class="editor-label">使用年限</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetUsedYear)电脑年 </td>
                <td class="editor-label">维护周期</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetMaintenanCycle)单位天 </td>
            </tr>
            <tr>
                <td class="editor-label">年折旧率</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetDepriciationRate)例如0.05 </td>
                <td class="editor-label">规格型号</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetSpecModel)
                </td>
            </tr>
            <tr>
                <td class="editor-label">采购编号</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetBuyCode)
                </td>
                <td class="editor-label">关联的合同号</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetContractID)
                </td>
            </tr>
            <tr>
                <td class="editor-label">采购发票</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetBuysssInvoiceNumber)
                </td>
                <td class="editor-label">入账日期</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetPurchaseTime)
                </td>
            </tr>
            <tr>
                <td class="editor-label">图片</td>
                <td colspan="3">
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetPictures)
                </td>
            </tr>
            <tr>
                <td class="editor-label">描述</td>
                <td colspan="3">
                    @Html.TextAreaFor(m => m.assetManagerModel.AssetDescript, 8, 100, "")
                </td>
            </tr>
            <tr>
                <td class="editor-label">盘点时间</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetInventoryTime, new { disabled = true })
                </td>
                <td class="editor-label">盘点是否存在</td>
                <td>
                    @Html.CheckBoxFor(m => m.assetManagerModel.AssetInventoryExists, new { @checked = true, disabled = true })
                </td>
            </tr>
            <tr>
                <td class="editor-label">盘点人</td>
                <td>
                    @Html.TextBoxFor(m => m.assetManagerModel.AssetInventoryMemberIDs, new { disabled = true })
                </td>
                <td></td>
                <td></td>
            </tr>
        </table>
        <div id="extForm" style="margin-top: 5px;">
        </div>
        <p style="padding: 10px 0px 0px 100px;">
            <input type="submit" value="保存" class="btn_green" />
            <input type="reset" value="重置" class="btn_orange" />
        </p>
    }
</div>
<script type="text/javascript">
    $(function () {
        $("#assetManagerModel_AssetOutManu").ligerDateEditor({ initValue: $("#assetManagerModel_AssetOutManu").val() });
        $("#assetManagerModel_AssetBuyTime").ligerDateEditor({ initValue: $("#assetManagerModel_AssetBuyTime").val() });
        $("#assetManagerModel_AssetPurchaseTime").ligerDateEditor({ initValue: $("#assetManagerModel_AssetPurchaseTime").val() });
        $("#assetManagerModel_AssetWarrantLastTime").ligerDateEditor({ initValue: $("#assetManagerModel_AssetWarrantLastTime").val() });
    });

    function getExtForm(id) {
        $.get('/Form/Index/' + id + '?aid=' + $('#aid').val() + '&t=' + Math.random(), function (data) {
            $("#extForm").html(data);
        });
    }

    getExtForm($('#assetManagerModel_AssetCID').val());
</script>
